package com.cjj.controller;


import com.cjj.service.TBodyTypeService;
import com.cjj.service.TmenberServiceCjj;
import com.cjj.vo.TBodyTypeVo;
import com.github.pagehelper.PageInfo;

import com.guigu.pojo.TBodyType;
import com.guigu.pojo.TMember;
import com.guigu.viwe.PageVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;



@RestController
@RequestMapping("/TbodyType")
public class TbodyTypeController {

    @Resource
    private TBodyTypeService tBodyTypeService;

    @Resource
    private TmenberServiceCjj tmenberServiceCjj;


    //    分页查询
    @RequestMapping("/queryByType")
    public PageInfo<TBodyTypeVo> queryByType(@RequestBody PageVo<TBodyTypeVo> pageVo){
        PageInfo<TBodyTypeVo> tBodyTypeVoPageInfo = this.tBodyTypeService.queryType(pageVo);
        return tBodyTypeVoPageInfo;
    }

//    查询是否有预约
    @RequestMapping("/queryfileName")
    public TMember queryfileName(String fileName){
        return  this.tmenberServiceCjj.querySubscribe(fileName);
    }

//  查询是否有体检过
    @RequestMapping("/queryTypeIsNull")
    public TBodyType queryTypeIsNull(String fileName){
        return this.tBodyTypeService.queryTypeIsNull(fileName);
    }

//    添加体检
    @RequestMapping("/addBodyType")
    public int  addBodyType(@RequestBody TBodyType tBodyType){
        return this.tBodyTypeService.addBodyType(tBodyType);
    }



}
